package com.kichina.parking.controller.base;

/**
 * @Author: yxh
 * @Description:
 * @Date: Created in 19:21 2020-11-25
 **/
public enum HttpCode {
    OK(200, "OK", "请求已经成功处理"),
    NO_DATA(402, "no data", "不满足逻辑条件"),
    PRECONDITION_FAILED(412, "Precondition Failed", "不满足请求的先决条件"),
    INTERNAL_SERVER_ERROR(500, "Internal Server Error", "服务器内部错误"),
    DATA_SOURCE_ERROR(501,"data source error","服务器端错误: 获取数据库连接异常"),
    HIT_CACHE_ERROR(501, "Hit cache error", "命中缓存异常"),
    BAD_LOGIN(400, "Bad LOGIN", "登录失败!"),
    UNAUTHORIZED(401, "Unauthorized", "没有被授权或者授权已经失效"),
    NOT_FOUND(404, "Not Found", "资源未找到");
    private final Integer code;
    private final String reasonPhraseUS;
    private final String reasonPhraseCN;



    HttpCode(Integer code, String reasonPhraseUS, String reasonPhraseCN) {
        this.code = code;
        this.reasonPhraseUS = reasonPhraseUS;
        this.reasonPhraseCN = reasonPhraseCN;
    }

    public Integer code() {
        return code;
    }

    public String reasonPhraseUS() {
        return reasonPhraseUS;
    }

    public String reasonPhraseCN() {
        return reasonPhraseCN;
    }
}
